import React from 'react';

import ReactDom from 'react-dom';

class MyForm extends React.Component{
    constructor(props){
        super(props);
        this.state = {body:'default',num:0};
    }

    change1(){
        ++this.state.num;
        this.setState({num:this.state.num});
    }

    render(){

        return <form action="" method="post">
            <textarea readOnly="false" value={this.state.body+this.state.num} style={{backgroundColor:'yellow'}} name="" id="" cols="30" rows="10"> </textarea>
            <button className={'testClass'} type="button" onClick={()=>{this.change1();}}>改变</button>
        </form>;
    }


}

ReactDom.render(<MyForm/>, document.querySelector('#app'));
